package com.xju.ikun.service.serviceImpl;

import com.xju.ikun.bean.UserBean;
import com.xju.ikun.dao.UserDao;
import com.xju.ikun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public UserBean loginIn(String name, String password) {
        return userDao.getUserInfo(name, password);
    }

    @Override
    public UserBean findByUserid(int userid) {
        return userDao.findByUserid(userid);
    }

    @Override
    public List<UserBean> findAll() {
        return userDao.findAll();
    }

    @Override
    public int insertUserBean(UserBean userBean) {
        return userDao.insertUserBean(userBean);
    }

    @Override
    public int updateByPrimaryKey(int userid,String username,String qq,String email,String nick,String tel) {
        return userDao.updateByPrimaryKey(userid,username,qq,email,nick,tel);
    }

    @Override
    public int deleteByPrimaryKey(int userid) {
        return userDao.deleteByPrimaryKey(userid);
    }
}
